<template name="teacherCard">
	<view class="cardCnt">
		<view class="imgBox">
			<image :src="teacherInfo.img"></image>
		</view>
		<view class="infoBox">
			<text class="teacherNick">{{teacherInfo.name}}</text>
			<view class="teachInfo">
				<text>{{teacherInfo.workAge}}年教龄</text>
				<text>已授{{teacherInfo.score}}节课</text>
			</view>
			<view class="fieldBox">
				<text>擅长：</text>
				<view class="tagBox">

					<text v-for="(item,index) in teacherInfo.labels" :key="index">{{item}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// vuex 导入
	import {
		mapState,
		mapGetters,
		mapMutation,
		mapActions
	} from "vuex";
	export default {
		name: 'teacherCard',
		// 计算属性
		computed: {
			// ...mapState({
			//     stateinfo:stata=>stata.file.stateinfo
			// }),
			// ...mapGetters({
			//     stateinfo:stata=>stata.file.stateinfo
			// })
		},
		// 传递参数
		props: {
			teacherInfo: {
				type: Object,
				default: null
			}
		},
		// 自身参数
		data() {
			return {

			}
		},
		// 方法
		methods: {

			methods1() {



			}
		},
		// created声明周期
		created() {

		},

	}
</script>

<style lang="less" scoped>
	@import "../../common/public.less";

	.cardCnt {
		background-color: #FFFFFF;
		display: flex;
		align-items: stretch;
		padding: 25upx 18upx 25upx 38upx;
		border-bottom: 14upx solid #f4f4f4;
		.imgBox {
			width: 166upx;
			height: 166upx;
			display: flex;
			overflow: hidden;
			border-radius: 50%;
			flex-shrink: 0;

			image {
				width: 166upx;
				height: 166upx;
			}
		}

		.infoBox {
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			margin-left: 20upx;
			
			.teacherNick {
				font-size: 32rpx;
				font-weight: bold;
				color: #202932;
			}

			.teachInfo {
				display: flex;
				align-items: center;

				text {
					font-size: 28rpx;
					color: #202932;
					margin-right: 20upx;
				}
			}

			.fieldBox {
				display: flex;
				align-items: center;

				>text {
					font-size: 28rpx;
					color: #202932;
					flex-shrink: 0;
				}
				.tagBox{
					display: flex;
					align-items: center;
					flex-wrap: wrap;
					>text{
						font-size: 20upx;
						color: #202932;
						height: 40upx;
						line-height: 40upx;
						border-radius: 20upx;
						padding: 0 10upx;
						background-color: #f6f6f6;
						margin-left: 10upx;
					}
				}
			}
		}
	}
</style>
